/*
 * Powered By [fdlm]
 * Web Site: http://www.fdlm.cn
 * Since 2014 - 2015
 */

package com.sjyy.order.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import cn.org.rapid_framework.util.DateConvertUtils;

import java.util.*;

import com.sjyy.order.model.*;
import com.sjyy.order.service.*;
import com.sjyy.order.vo.query.*;

import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @author cty email:caotianye@fdlm.cn
 * @version 1.0
 * @since 1.0
 */


public class Order extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Order";
	public static final String ALIAS_ORDER_ID = "orderId";
	public static final String ALIAS_ACCOUNT_ID = "accountId";
	public static final String ALIAS_DOCTOR_ID = "doctorId";
	public static final String ALIAS_NUMBER = "number";
	public static final String ALIAS_STATUS = "status";
	public static final String ALIAS_QUESTION_DESCIPTION = "questionDesciption";
	public static final String ALIAS_ORDER_REMARK = "orderRemark";
	public static final String ALIAS_CREATE_TIME = "createTime";
	
	//date formats
	public static final String FORMAT_CREATE_TIME = DATE_FORMAT;
	
	//columns START
    /** orderId       db_column: order_id */	
	
	private java.lang.Integer orderId;
    /** accountId       db_column: account_id */	
	@NotNull 
	private java.lang.Integer accountId;
    /** doctorId       db_column: doctor_id */	
	@NotNull 
	private java.lang.Integer doctorId;
    /** number       db_column: number */	
	@NotNull 
	private java.lang.Integer number;
    /** status       db_column: status */	
	@NotNull 
	private java.lang.Integer status;
    /** questionDesciption       db_column: question_desciption */	
	@Length(max=256)
	private java.lang.String questionDesciption;
    /** orderRemark       db_column: order_remark */	
	@NotBlank @Length(max=256)
	private java.lang.String orderRemark;
    /** createTime       db_column: create_time */	
	@NotNull 
	private java.util.Date createTime;
	//columns END

	public Order(){
	}

	public Order(
		java.lang.Integer orderId
	){
		this.orderId = orderId;
	}

	public void setOrderId(java.lang.Integer value) {
		this.orderId = value;
	}
	
	public java.lang.Integer getOrderId() {
		return this.orderId;
	}
	public void setAccountId(java.lang.Integer value) {
		this.accountId = value;
	}
	
	public java.lang.Integer getAccountId() {
		return this.accountId;
	}
	public void setDoctorId(java.lang.Integer value) {
		this.doctorId = value;
	}
	
	public java.lang.Integer getDoctorId() {
		return this.doctorId;
	}
	public void setNumber(java.lang.Integer value) {
		this.number = value;
	}
	
	public java.lang.Integer getNumber() {
		return this.number;
	}
	public void setStatus(java.lang.Integer value) {
		this.status = value;
	}
	
	public java.lang.Integer getStatus() {
		return this.status;
	}
	public void setQuestionDesciption(java.lang.String value) {
		this.questionDesciption = value;
	}
	
	public java.lang.String getQuestionDesciption() {
		return this.questionDesciption;
	}
	public void setOrderRemark(java.lang.String value) {
		this.orderRemark = value;
	}
	
	public java.lang.String getOrderRemark() {
		return this.orderRemark;
	}
	public String getCreateTimeString() {
		return DateConvertUtils.format(getCreateTime(), FORMAT_CREATE_TIME);
	}
	public void setCreateTimeString(String value) {
		setCreateTime(DateConvertUtils.parse(value, FORMAT_CREATE_TIME,java.util.Date.class));
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("OrderId",getOrderId())
			.append("AccountId",getAccountId())
			.append("DoctorId",getDoctorId())
			.append("Number",getNumber())
			.append("Status",getStatus())
			.append("QuestionDesciption",getQuestionDesciption())
			.append("OrderRemark",getOrderRemark())
			.append("CreateTime",getCreateTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getOrderId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Order == false) return false;
		if(this == obj) return true;
		Order other = (Order)obj;
		return new EqualsBuilder()
			.append(getOrderId(),other.getOrderId())
			.isEquals();
	}
}

